<?php

switch($page) {
	case 'assignment_manager':
		$assin_sel = 'class="select"';
		break;
	case 'university':
		$univ_sel = 'class="select"';
		break;
	case 'classifieds':
		$clsfied_sel = 'class="select"';
		break;
	case 'jobs':
		$jobs_sel = 'class="select"';
		break;
	case 'books':
		$books_sel = 'class="select"';
		break;
	case 'technology':
		$tech_sel = 'class="select"';
		break;
	case 'contact_us':
		$contact_sel = 'class="select"';
		break;
	default:
		$home_sel = 'class="select"';
		break;
}

$top_banner = $base_obj->getTopBanner($page);
$right_banner = $base_obj->getRightBanner($page);
?>
<script type="text/javascript" src="js/chrome.js"></script>
<div class="header"> <div  class="logo"><a href="index.php"><img src="images/logo.png" width="300" height="80" alt="" /></a>
  <div style="float:left;" id="logo_caption"></div>
    </div>
    <!-- Begin headerRight -->
    <div  class="headerRight"> 
    <div style="width:306px;height:88px;float:left;">
    <?php echo $base_obj->drawFlashObject($top_banner,306,88);?>
    </div>
      <!-- Begin headerRightTopMenu -->
      <div class="headerRightTopMenu">
        <ul>
           <li>
          <?php if($_SESSION['user_id']=="")
		  {
          echo '<a href="index.php?page=login">Login</a>';
          }
		  else
		  {
			 echo '<a href="index.php?page=logout">Logout</a>';  
		  }
		  ?>
		  
          </li>	
         
          <li><a href="index.php?page=register">Register</a></li>
          <li><a href="index.php?page=forgot_password">Forgot Password</a></li>
        </ul>
      </div>
      <!-- End headerRightTopMenu -->
      <form name="frmSearch" onsubmit="return validateSearch()">
      <table width="290" border="0" cellspacing="0" cellpadding="0" align="center"  class="searchTbl">
        <tr>
          <td  class="searchbox"><input name="txt_search" id="txt_search" type="text"  class="searchTxt"   onblur="if (this.value == '') {this.value = 'search';}" onfocus="if (this.value == 'search') {this.value = '';}" value="search" /></td>
          <td align="right"><input name="" type="image" src="images/searchBtns.jpg" /></td>
        </tr>
      </table>
      </form>
    </div>
    <!-- End headerRight -->
    <div style="clear:both;"></div>
    <!-- Begin menuArea -->
    <div class="menuArea" id="chromemenu">
      <ul>
       <?php
		$sql = "SELECT * FROM page WHERE parent_page='0' and page_name not like 'common' ORDER BY order_id ASC LIMIT 0,8";
		$res = $base_obj->exec_query($sql);
		$data = $base_obj->fetch_row_all($res);	
		
		for($i=0;$i<count($data);$i++) {
			$is_parent_page = $base_obj->isParentPage($data[$i]['id']);
			$rec = "";
			$sel_class = "";
			$rel = "";
			
			if($i == (count($data)-1)) {
				$rec = 'id="no"';
			}
			
			if($page == $data[$i]['link_name']) {
				$sel_class = 'class="select"';
			}
			
			if($is_parent_page == 1) {
				$rel = 'rel="dropmenu'.$data[$i]['id'].'"';
			}
			
			echo '<li '.$rec.'><a href="index.php?page='.$data[$i]['link_name'].'" '.$sel_class.' '.$rel.'>'.$data[$i]['page_name'].'</a></li>';
		}
	   ?>
      </ul>
      <?php
		$sql = "SELECT a.id, b.page_name, a.page_name parent_page, b.link_name, a.link_name parent_link
				FROM ".$base_obj->PAGE." a
				INNER JOIN ".$base_obj->PAGE." b ON ( a.id = b.parent_page )
				WHERE a.active_status = '1'
				AND b.active_status = '1'
				ORDER BY a.order_id,b.order_id ASC";
		$res = $base_obj->exec_query($sql);
		$data = $base_obj->fetch_row_all($res);	
		
		$id = "";
		for($i=0;$i<count($data);$i++) {
			 if($id != $data[$i]['id']) {
				$id = $data[$i]['id'];
				if($i != 0) {
					echo '</div>';
				}
				echo '<div id="dropmenu'.$id.'" class="dropmenudiv">';
			 }
			 echo '<a href="index.php?page='.$data[$i]['parent_link'].'&view='.$data[$i]['link_name'].'">'.$data[$i]['page_name'].'</a>';
			 
			if($i == (count($data)-1)) {
				echo '</div>';
			}
		}
		?>
      <!--1st drop down menu -->                                                   

<script type="text/javascript">

cssdropdown.startchrome("chromemenu")

</script>

    </div>
    <!-- End menuArea -->
  </div>